<?php
function log_error($num, $str, $file, $line)
{
    $message = date("Y-m-d H:i:s") . " 文件：{$file},行数：{$line},错误信息：{$str}";
    file_put_contents("../api_resource/logs/" . date("Ymd") . "_api.log", $message . PHP_EOL, FILE_APPEND);
}
set_error_handler("log_error");

include_once '../api_resource/mysql_pdo.php';

include_once '../api_resource/functions.php';


$params = $_POST;
$act = $params['act'] ?? 'checkOrder';
// $uid = $params['uid'] ?? 0;
// $timestamp = $params['timestamp'] ?? 0;
// $sign = $params['sign'] ?? '';


$db = new mysql_pdo();



include_once '../api_resource/CzOrder.php';

$CzOrder = new CzOrder($params, $db, []);
if ($act == 'checkOrder') {
    $CzOrder->checkOrder();
}


error('未知请求操作');
